import request from '@/utils/request'

// 删除出库单
export function deleteShipOrder(id) {
  return request({
    url: '/hs/ship-order/delete?id=' + id,
    method: 'delete'
  })
}

// 获得出库单
export function getShipOrder(id) {
  return request({
    url: '/hs/ship-order/get?id=' + id,
    method: 'get'
  })
}

// 获得出库单分页
export function getShipOrderPage(params) {
  return request({
    url: '/hs/ship-order/page',
    method: 'get',
    params
  })
}
// 导出出库单 Excel
export function exportShipOrderExcel(params) {
  return request({
    url: '/hs/ship-order/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}

// 更新出库单状态为出库中
export function ship(shipOrderId) {
  return request({
    url: '/hs/ship-order/ship?shipOrderId=' + shipOrderId,
    method: 'post',
  })
}


// 手动创建出库单
export function createManualShipOrder(data) {
  return request({
    url: '/hs/ship-order/create-manual',
    method: 'post',
    data: data
  })
}
